//
//  BaseCommondViewController.m
//  LoanMoney
//
//  Created by gynjobs on 2017/8/28.
//  Copyright © 2017年 cangming. All rights reserved.
//

#import "BaseCommondViewController.h"

@interface BaseCommondViewController ()

@end

@implementation BaseCommondViewController
/** 设置导航栏左侧按钮 **/
-(UIImageView *)setLeftNavigationButtonIconName:(NSString *)itemName AndSize:(CGSize )size{
    UIImage *rightImage;
    rightImage =[UIImage imageNamed:itemName];
    UIView *view = [[UIView alloc]init];
    view.backgroundColor = [UIColor clearColor];
    view.frame = CGRectMake(0, 0, R_Y_H(size.width), R_Y_W(size.height));
    UIImageView *imageView = [[UIImageView alloc]init];
    imageView.image = rightImage;
    imageView.backgroundColor = [UIColor clearColor];
    imageView.frame = CGRectMake(0, 0, R_Y_W(size.width), R_Y_H(size.height));
    [view addSubview:imageView];
    imageView.userInteractionEnabled = YES;
    
    UIBarButtonItem *item =[[UIBarButtonItem alloc]initWithCustomView:view];
    self.navigationItem.leftBarButtonItem = item;
    //滑动返回
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    return imageView;
}
-(UIButton *)addLeftBackButtonForNoneNavi{
    UIImage *rightImage;
    rightImage =[UIImage imageNamed:@"返回icon"];
    UIView *view = [[UIView alloc]init];
    view.backgroundColor = [UIColor clearColor];
    view.frame = CGRectMake(0, 0, R_Y_H(30), R_Y_W(60));
    UIButton *imageView = [UIButton buttonWithType:UIButtonTypeCustom];
    [imageView setImage:rightImage forState:UIControlStateNormal];
    imageView.backgroundColor = [UIColor clearColor];
    imageView.frame = CGRectMake(0, 0, R_Y_W(40), R_Y_H(60));
    [view addSubview:imageView];
    imageView.userInteractionEnabled = YES;
    return imageView;
}
- (void)showToastAddWithTitle:(NSString *)title {
    [LoadingAnimalView showToastAddedTo:self.view withTitle:title withBlock:nil];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
